home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3224 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: free
  5. Date: Sat, 27 Jan 96 00:21:50 GMT
  6. Organization: none
  7. Distribution: world
  8. Message-ID: <822702110snz@genesis.demon.co.uk>
  9. References: <4e908i$3vq@news.utdallas.edu>
  10. Reply-To: fred@genesis.demon.co.uk
  11. X-NNTP-Posting-Host: genesis.demon.co.uk
  12. X-Newsreader: Demon Internet Simple News v1.27
  13. X-Mail2News-Path: genesis.demon.co.uk
  14.  
  15. In article <4e908i$3vq@news.utdallas.edu>
  16.            $USER@utdallas.edu "Robert B Szerbiak" writes:
  17.  
  18. >Keywords:
  19. >
  20. >Can anyone tell me how to fine the length of an array deallocated with a call
  21. > to free.
  22. >I tried looking at using the pointer in sizeof but it only returns the size of
  23. > the
  24. >pointer. Thanks.
  25.  
  26. If it is deallocated it has no length! :-)
  27.  
  28. C doesn't provide any method of determining the size of a heap allocated
  29. object - you simply have to note the size somewhere when you allocate it.
  30.  
  31. -- 
  32. -----------------------------------------
  33. Lawrence Kirby | fred@genesis.demon.co.uk
  34. Wilts, England | 70734.126@compuserve.com
  35. -----------------------------------------
  36.